Feature/jcode integration - #2578
Conversation
RED: tests/test_jcode.py fails because jcode install and jcode-hook are not implemented. AI-assisted: Jcode
Install the Graphify skill under ~/.jcode, safely merge the Jcode pre_tool hook, and redirect the first raw code lookup per session to graphify query. GREEN: 213 focused and adjacent tests pass; isolated installer/hook acceptance workflow passes. AI-assisted: Jcode
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Graphify review — findings
This PR adds support for a new "Jcode" platform in the graphify install/uninstall tooling. It registers a Jcode Agent Skill, wires up a jcode-hook pre-tool guard (invoked via a new CLI command) that redirects raw search/read tool calls toward graphify query, and adds config.toml manipulation helpers to insert/remove the hook from Jcode's hooks.pre_tool setting. It also updates the README, CLI usage text, __main__ imports, uninstall-all cleanup, and a .gitattributes merge driver entry for graph.json. The surface area spans graphify/install.py (platform config, hook install/uninstall, TOML editing helpers), graphify/cli.py (hook guard logic and command dispatch), graphify/__main__.py (imports and usage), plus documentation and gitattributes.
Worth a look
- jcode-hook guard blocks 'read' tool without checking target is indexed —
graphify/cli.py· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 488 functions depend on the 237 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
dispatch_command()— 2 callers, 118 callees - worse:
dispatch_install_cli()— 2 callers, 32 callees - worse:
install()— 5 callers, 12 callees - worse:
uninstall_all()— 2 callers, 14 callees
Verification — 488 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 488 function(s) in the blast radius were not formally verified this run
· 4 more finding(s) on lines outside this diff (see the check run).
AI-assisted: Jcode
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Formal verification. 1 change(s) alter behavior, breaking input(s) attached.
Behavior changes: \_node\_search\_text changes behavior, here is the input that shows it.
The verifier found a concrete input on which \_node\_search\_text behaves differently before and after the change. If that change is intended, ship it; if not, this is your bug.
Guarantee: This difference was REPRODUCED, the verifier actually ran both versions on that input and saw them disagree. It is real, not an artifact.
Evidence: On input \{"data":"\{'n': 0, 's': 'x', 'l': \[1, 2\]\}","nid":"'a longer string'"\}, the old code produced '\\x00\\x00a longer string\\x00\\x00' but the new code produces '\\x00\\x00a longer string\\x00\\x00\\x00'. Paste that input straight into a regression test.
Graphify review — findings
This pull request adds native ingestion of lat.md/ validated-knowledge Markdown into Graphify's graph, so that headings become knowledge-section nodes with summaries, wiki links, source links, and @lat code references are wired into the code graph. It introduces a new check-knowledge CLI command (with a --json option) for validating link/reference integrity, plus a supporting graphify/lattice_ingest.py module, new tests, and TDD documentation. Separately, it adds Jcode as a supported install platform, including install/uninstall hook functions, a Jcode hook guard in the CLI, and related help-text and README updates. It also adds a git merge attribute for graphify-out/graph.json.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1999 functions depend on the 594 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 388 callers, 43 callees - worse:
dispatch_command()— 2 callers, 119 callees - worse:
_get_extractor()— 26 callers, 7 callees - worse:
_query_graph_text()— 20 callers, 8 callees - worse:
dispatch_install_cli()— 2 callers, 32 callees - worse:
install()— 5 callers, 12 callees - new:
validate_lattice()— 7 callers, 7 callees - worse:
uninstall_all()— 2 callers, 14 callees - …and 2 more
Verification — 1999 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 1999 function(s) in the blast radius were not formally verified this run
Formal verification
Behavior changes: \_node\_search\_text changes behavior, here is the input that shows it.
The verifier found a concrete input on which \_node\_search\_text behaves differently before and after the change. If that change is intended, ship it; if not, this is your bug.
Guarantee: This difference was REPRODUCED, the verifier actually ran both versions on that input and saw them disagree. It is real, not an artifact.
Evidence: On input \{"data":"\{'n': 0, 's': 'x', 'l': \[1, 2\]\}","nid":"'a longer string'"\}, the old code produced '\\x00\\x00a longer string\\x00\\x00' but the new code produces '\\x00\\x00a longer string\\x00\\x00\\x00'. Paste that input straight into a regression test.
No difference found (not proven): No behavior difference found in \_run\_cli (not a proof).
The verifier ran both versions of \_run\_cli on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify dispatch\_command.
The verifier did not have enough to check dispatch\_command, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 9 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)
Could not verify: Could not verify \_get\_extractor.
The verifier did not have enough to check \_get\_extractor, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set
Could not verify: Could not verify extract.
The verifier did not have enough to check extract, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `cache_root` is annotated `Path | None` — outside the synthesizable primitive/collection set
No difference found (not proven): No behavior difference found in dispatch\_install\_cli (not a proof).
The verifier ran both versions of dispatch\_install\_cli on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify install.
The verifier did not have enough to check install, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 9 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)
Could not verify: Could not verify uninstall\_all.
The verifier did not have enough to check uninstall\_all, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: the input domain has 28 values but only 14 distinct were tested — a small finite domain must be EXHAUSTED, not sampled (an untested input could invert the result)
No difference found (not proven): No behavior difference found in \_compute\_idf (not a proof).
The verifier ran both versions of \_compute\_idf on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify \_score\_query.
The verifier did not have enough to check \_score\_query, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 35 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly TypeError — names the real obstacle, not a sampling gap)
No difference found (not proven): No behavior difference found in \_subgraph\_to\_text (not a proof).
The verifier ran both versions of \_subgraph\_to\_text on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
· 4 grounded finding(s) anchored inline below; 6 more finding(s) on lines outside this diff (see the check run).
| @@ -4719,6 +4726,11 @@ def _is_cpp_header(path: Path) -> bool: | |||
|
|
|||
| def _get_extractor(path: Path) -> Any | None: | |||
There was a problem hiding this comment.
_get_extractor()
fans out to 7 callees (efferent coupling); 26 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| return resolved, None | ||
|
|
||
|
|
||
| def extract_lattice_markdown(path: Path) -> dict[str, Any]: |
There was a problem hiding this comment.
extract_lattice_markdown()
fans out to 7 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| edge["resolved_knowledge_target"] = resolved | ||
|
|
||
|
|
||
| def extract_lattice_code_ref_edges( |
There was a problem hiding this comment.
extract_lattice_code_ref_edges()
high coupling complexity (Ca·Ce = 15).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| ) | ||
|
|
||
|
|
||
| def validate_lattice(project_root: Path) -> dict[str, Any]: |
There was a problem hiding this comment.
validate_lattice()
fans out to 7 callees (efferent coupling); 7 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
AI-assisted: Jcode
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This pull request adds native ingestion and validation of lat.md/ "validated knowledge" directories into Graphify's graph, so Markdown headings, summaries, wiki links, source references, and @lat code-mention comments become graph nodes/edges queryable alongside code symbols. It introduces a new lattice_ingest module, a check-knowledge CLI command (with --json), automatic validation during graphify update, and touches extraction, serving/query, and CLI/main wiring. It also adds a new "Jcode" install platform (_install_jcode_hook/_uninstall_jcode_hook), related README/docs updates, TDD evidence documentation, and a .gitattributes merge driver for graph.json.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 2006 functions depend on the 601 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 388 callers, 43 callees - worse:
dispatch_command()— 5 callers, 120 callees - worse:
_get_extractor()— 26 callers, 7 callees - worse:
_query_graph_text()— 20 callers, 8 callees - worse:
dispatch_install_cli()— 2 callers, 32 callees - worse:
install()— 5 callers, 12 callees - new:
validate_lattice()— 8 callers, 7 callees - worse:
uninstall_all()— 2 callers, 14 callees - …and 1 more
Verification — 2006 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 2006 function(s) in the blast radius were not formally verified this run
· 4 grounded finding(s) anchored inline below; 5 more finding(s) on lines outside this diff (see the check run).
| ) | ||
|
|
||
|
|
||
| def dispatch_command(cmd: str) -> None: |
There was a problem hiding this comment.
dispatch_command()
fans out to 120 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| @@ -4719,6 +4726,11 @@ def _is_cpp_header(path: Path) -> bool: | |||
|
|
|||
| def _get_extractor(path: Path) -> Any | None: | |||
There was a problem hiding this comment.
_get_extractor()
fans out to 7 callees (efferent coupling); 26 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| return resolved, None | ||
|
|
||
|
|
||
| def extract_lattice_markdown(path: Path) -> dict[str, Any]: |
There was a problem hiding this comment.
extract_lattice_markdown()
fans out to 7 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
| ) | ||
|
|
||
|
|
||
| def validate_lattice(project_root: Path) -> dict[str, Any]: |
There was a problem hiding this comment.
validate_lattice()
fans out to 7 callees (efferent coupling); 8 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
No description provided.